TextLab -- Bruce Blumberg, Ali Ozer, NeXT Developer Support
This is the third of four labs designed for the NeXT Developer's Camp. It is a multi-window, multi-font text editor that saves and opens files by archiving the objects making up the on-screen representation of the file, rather than extracting the characters of the file alone.
This program is a good place to start in creating a multi-window editor, although you might want to change the TextView class so that it uses a nib file to create its objects, rather than programmatically. The text object has grown quite a bit since this program was originally written, under 0.8, so there are a lot of features, such as document rulers, spell checking, mixed text and graphics and cut and copy fonts attributes, that might be fun to add.
Note how little code is actually needed for printing. Note the arrangements needed to create a scrolling object: basically, create the ScrollView and install your view as its DocView. If your view draws thru its drawSelf:: method, only the code shown here is necessary for it to be scrolled over.
This program has not been rewritten for 2.0. The modifications necessary were cosmetic, not fundamental. An amazing amount of functionality was added simply by dragging in menu items in Interface Builder: Windows menu, Services menu, Format menu, with Text and Font menus, all for free.